#ifndef __CABUFFERH__
#define __CABUFFERH__

#include "calist.h"

typedef struct {
	pthread_mutex_t mutex;
	int count;
	int size;
	lklist *free_bufs;
	lklist *fill_bufs;
	lklist *res;
} es_bufman_t;

int es_bufman_init(es_bufman_t *pman, int size);
lklist* es_bufman_get(es_bufman_t* pman);
void es_bufman_return(es_bufman_t* pman, lklist* pitem);
void es_bufman_push(es_bufman_t* pman, lklist* p);
lklist* es_bufman_pop(es_bufman_t* pman);
void es_bufman_free(es_bufman_t* pman);


#endif
